﻿namespace Slick.Formatters
{
	/// <summary>
	/// Helps create builtin formatters of SlickGrid
	/// </summary>
	public static class SlickFormatters
	{
		private static PercentCompleteFormatter _percentCompleteFormatter;
		private static PercentCompleteBarFormatter _percentCompleteBarFormatter;
		private static YesNoFormatter _yesNoFormatter;
		private static CheckmarkFormatter _checkmarkFormatter;

		/// <summary>
		/// Returns instance of <see cref="PercentCompleteFormatter"/>.
		/// <para>Create only one instance in domain.</para>
		/// </summary>
		public static PercentCompleteFormatter PercentCompleteFormatter
		{
			get { return _percentCompleteFormatter ?? (_percentCompleteFormatter = new PercentCompleteFormatter()); }
		}

		/// <summary>
		/// Returns instance of <see cref="PercentCompleteBarFormatter"/>.
		/// <para>Create only one instance in domain.</para>
		/// </summary>
		public static PercentCompleteBarFormatter PercentCompleteBarFormatter
		{
			get { return _percentCompleteBarFormatter ?? (_percentCompleteBarFormatter = new PercentCompleteBarFormatter()); }
		}

		/// <summary>
		/// Returns instance of <see cref="YesNoFormatter"/>.
		/// <para>Create only one instance in domain.</para>
		/// </summary>
		public static YesNoFormatter YesNoFormatter
		{
			get { return _yesNoFormatter ?? (_yesNoFormatter = new YesNoFormatter()); }
		}

		/// <summary>
		/// Returns instance of <see cref="CheckmarkFormatter"/>.
		/// <para>Create only one instance in domain.</para>
		/// </summary>
		public static CheckmarkFormatter CheckmarkFormatter
		{
			get { return _checkmarkFormatter ?? (_checkmarkFormatter = new CheckmarkFormatter()); }
		}
	}
}